package info.openlvb.openface.client.base.machine;


import info.openlvb.openface.client.handler.AddMachineListener;
import info.openlvb.openface.client.handler.ClearMachineListener;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.form.FormPanel;
import com.gwtext.client.widgets.form.TextField;

public class AddMachinePanel extends VerticalPanel {

	//ListBox lst_ip;
	TextField machine_nm,machine_desc;
	
	public AddMachinePanel(){
		
		FormPanel formPanel = new FormPanel();
		formPanel.setFrame(true);
        formPanel.setTitle("Ajout d'un ordinateur");
        formPanel.setLabelWidth(250);
        formPanel.setWidth(600);
		
        machine_nm = new TextField("Nom de l'ordinateur", "name_pc", 250);
        machine_nm.setAllowBlank(false);
        machine_nm.setDisabled(false);
        formPanel.add(machine_nm);
		
		machine_desc = new TextField("Description de l'ordinateur", "desc_pc", 250);
        machine_desc.setAllowBlank(true);
        machine_desc.setDisabled(false);
        formPanel.add(machine_desc);
		
        Button addmachine = new Button("Ajouter la machine");
        addmachine.addListener(new AddMachineListener(this));
        formPanel.addButton(addmachine);
        
        Button clearmachine = new Button("Annuler");
        clearmachine.addListener(new ClearMachineListener(this));
        formPanel.addButton(clearmachine);
        
        add(formPanel);
	}

	public TextField getMachine_nm() {
		return machine_nm;
	}

	public TextField getMachine_desc() {
		return machine_desc;
	}	
}
